Loading TOC...

MarkLogic 9 Product Documentation
GET /manage/v2/tickets/{tid}?view=process-status

Summary

Check the status of the ticket identified by {tid}.

URL Parameters
format The format of the returned data. Can be either html, json, or xml (default). If present, the format parameter overrides the Accept header.
Request Headers
Accept The expected MIME type of the response. If the format parameter is present, it takes precedence over the Accept header. Allowed values: application/xml, application/json, and text/html.
Response Headers
Content-type The MIME type of the data in the response body. Depending upon the value of the format parameter or Accept header, one of application/xml, application/json, or text/html.

Response

If the ticket is still open, MarkLogic Server responds with status code 200 (OK) and the response body contains status details. If the ticket is closed, MarkLogic Server returns status code 303 and the response body includes status details and a link back to the resource upon which the related process was run. See the Usage Notes for an alternative request that avoids the redirect.

Required Privileges

This operation requires the manage-user role, or the following privilege:

http://marklogic.com/xdmp/privileges/manage

Usage Notes

Use the ticket system to track long-running or asynchronous operations such as combining forests or resizing a partition. For such operations, the Management REST API returns a ticket reference that you can use to invoke this service and check the status of your ticket. For a completed operation, the status information includes error details, if any.

You can avoid the redirect response for a completed ticket by omitting the view=process-status request parameter. Leaving the view parameter off requests the default view. Such a request returns a status code 200 (OK), with status details in the response body.

If you specify forest-replicas, two or more forests are created: The master forest on one host and one or more replica forests on other hosts. Note that all of the hosts must be in the same cluster. See example below.

Example


$ curl --anyauth --user user:password -X GET \
    -i -H "Accept: application/xml" \
    http://localhost:8002/manage/v2/tickets/6699732791380391489?view=process-status

==> Retrieve ticket status information. If the ticket is still open,
    MarkLogic Server returns headers similar to the following. The
    response body contains annotations and status data about the process.

HTTP/1.1 200 OK
Server: MarkLogic
Content-Type: text/plain; charset=UTF-8
Content-Length: 32
Connection: Keep-Alive
Keep-Alive: timeout=5

<ticket-process-status xmlns="http://marklogic.com/manage/tickets">
  <id>6699732791380391489</id>
  ...
  <status-properties>
    <status>active</status>
    <start-time>2013-09-21T12:02:54.866173-07:00</start-time>
    <ticket-expiration>2013-09-28T12:02:54.866173-07:00</ticket-expiration>
    <database>App-Services</database>
    ...
  </status-properties>
  ...
</ticket-process-status>
    

Example


$ curl --anyauth --user user:password -X GET \
    -i -H "Accept: application/xml" \
    http://localhost:8002/manage/v2/tickets/6699732791380391489?view=process-status

==> If the ticket is closed, MarkLogic Server returns a redirect
    to the resource upon which the related operation was performed.
    The response is similar to the following:

HTTP/1.1 303 See Other
Location: /manage/v2/forests
Content-type: application/xml
Cache-Control: no-cache
Expires: -1
Server: MarkLogic
Content-Length: 1612
Connection: Keep-Alive
Keep-Alive: timeout=5

<ticket-process-status xmlns="http://marklogic.com/manage/tickets">
  <id>6699732791380391489</id>
  ...
  <status-properties>
    <status>completed</status>
    <start-time>2013-09-21T12:02:54.866173-07:00</start-time>
    <ticket-expiration>2013-09-28T12:02:54.866173-07:00</ticket-expiration>
    <database>App-Services</database>
    ...
    <time-consumed>PT41.128523S</time-consumed>
    <errors>0</errors>
    ...
  </status-properties>
  ...
</ticket-process-status>
    

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.